//node操作mysql数据库
let mysql = require("mysql");
//创建Mysql的connection对象
let connection = mysql.createConnection(
    {
        host: '127.0.0.1',
        port: 3306,
        user: '',
        password: '',
        database: 'spring-cloud'
    }
);
//开辟连接
connection.connect();
//执行curd
connection.query("select * from t_order", function (error, results, fields) {
    //出错，抛出
    if (error) throw error;
    console.log("results", results);
});
//关闭连接
connection.end();

